home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 11.3 KB | 567 lines | [TEXT/MPS ] |
- ;
- ; File: Printing.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__PRINTING__') = 'UNDEFINED' THEN
- __PRINTING__ SET 1
-
-
- IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
- include 'Errors.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- ; include 'Types.a' ;
- ; include 'MixedMode.a' ;
- ; include 'QuickdrawText.a' ;
-
- IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
- include 'Dialogs.a'
- ENDIF
- ; include 'Memory.a' ;
- ; include 'Windows.a' ;
- ; include 'Events.a' ;
- ; include 'OSUtils.a' ;
- ; include 'Controls.a' ;
- ; include 'Menus.a' ;
- ; include 'TextEdit.a' ;
-
- iPFMaxPgs EQU 128
- iPrPgFract EQU 120 ;Page scale factor. ptPgSize (below) is in units of 1/iPrPgFract
- iPrPgFst EQU 1 ;Page range constants
- iPrPgMax EQU 9999
- iPrRelease EQU 3 ;Current version number of the code.
- iPrSavPFil EQU -1
- iPrAbort EQU $0080
- iPrDevCtl EQU 7 ;The PrDevCtl Proc's ctl number
- lPrReset EQU $00010000 ;The PrDevCtl Proc's CParam for reset
- lPrLineFeed EQU $00030000
- lPrLFStd EQU $0003FFFF ;The PrDevCtl Proc's CParam for std paper advance
- lPrLFSixth EQU $0003FFFF
- lPrPageEnd EQU $00020000 ;The PrDevCtl Proc's CParam for end page
- lPrDocOpen EQU $00010000
- lPrPageOpen EQU $00040000
- lPrPageClose EQU $00020000
- lPrDocClose EQU $00050000
- iFMgrCtl EQU 8 ;The FMgr's Tail-hook Proc's ctl number
- iMscCtl EQU 9 ;The FMgr's Tail-hook Proc's ctl number
- iPvtCtl EQU 10 ;The FMgr's Tail-hook Proc's ctl number
-
- pPrGlobals EQU $00000944 ;The PrVars lo mem area:
- bDraftLoop EQU 0
- bSpoolLoop EQU 1
- bUser1Loop EQU 2
- bUser2Loop EQU 3
- fNewRunBit EQU 2
- fHiResOK EQU 3
- fWeOpenedRF EQU 4
- ;Driver constants
- iPrBitsCtl EQU 4
- lScreenBits EQU 0
- lPaintBits EQU 1
- lHiScreenBits EQU $00000002 ;The Bitmap Print Proc's Screen Bitmap param
- lHiPaintBits EQU $00000003 ;The Bitmap Print Proc's Paint [sq pix] param
- iPrIOCtl EQU 5
- iPrEvtCtl EQU 6 ;The PrEvent Proc's ctl number
- lPrEvtAll EQU $0002FFFD ;The PrEvent Proc's CParam for the entire screen
- lPrEvtTop EQU $0001FFFD ;The PrEvent Proc's CParam for the top folder
- iPrDrvrRef EQU -3
-
- getRslDataOp EQU 4
- setRslOp EQU 5
- draftBitsOp EQU 6
- noDraftBitsOp EQU 7
- getRotnOp EQU 8
- NoSuchRsl EQU 1
- OpNotImpl EQU 2 ;the driver doesn't support this opcode
- RgType1 EQU 1
-
- feedCut EQU 0
- feedFanfold EQU 1
- feedMechCut EQU 2
- feedOther EQU 3
-
- scanTB EQU 0
- scanBT EQU 1
- scanLR EQU 2
- scanRL EQU 3
-
- ; A Rect Ptr
- TPrPort RECORD 0
- gPort ds GrafPort ;The Printer's graf port.
- gProcs ds QDProcs ;..and its procs
- lGParam1 ds.l 1 ;16 bytes for private parameter storage.
- lGParam2 ds.l 1
- lGParam3 ds.l 1
- lGParam4 ds.l 1
- fOurPtr ds.b 1 ;Whether the PrPort allocation was done by us.
- fOurBits ds.b 1 ;Whether the BitMap allocation was done by us.
- sizeof EQU 178
- ENDR
-
- ; Printing Graf Port. All printer imaging, whether spooling, banding, etc, happens "thru" a GrafPort.
- ; This is the "PrPeek" record.
- TPrInfo RECORD 0
- iDev ds.w 1 ;Font mgr/QuickDraw device code
- iVRes ds.w 1 ;Resolution of device, in device coordinates
- iHRes ds.w 1 ;..note: V before H => compatable with Point.
- rPage ds Rect ;The page (printable) rectangle in device coordinates.
- sizeof EQU 14
- ENDR
-
- ; Print Info Record: The parameters needed for page composition.
- TPrStl RECORD 0
- wDev ds.w 1
- iPageV ds.w 1
- iPageH ds.w 1
- bPort ds.b 1
- feed ds.b 1
- sizeof EQU 8
- ENDR
-
- TPrXInfo RECORD 0
- iRowBytes ds.w 1
- iBandV ds.w 1
- iBandH ds.w 1
- iDevBytes ds.w 1
- iBands ds.w 1
- bPatScale ds.b 1
- bUlThick ds.b 1
- bUlOffset ds.b 1
- bUlShadow ds.b 1
- scan ds.b 1
- bXInfoX ds.b 1
- sizeof EQU 16
- ENDR
-
- TPrJob RECORD 0
- iFstPage ds.w 1 ;Page Range.
- iLstPage ds.w 1
- iCopies ds.w 1 ;No. copies.
- bJDocLoop ds.b 1 ;The Doc style: Draft, Spool, .., and ..
- fFromUsr ds.b 1 ;Printing from an User's App (not PrApp) flag
- pIdleProc ds.l 1 ;The Proc called while waiting on IO etc.
- pFileName ds.l 1 ;Spool File Name: NIL for default.
- iFileVol ds.w 1 ;Spool File vol, set to 0 initially
- bFileVers ds.b 1 ;Spool File version, set to 0 initially
- bJobX ds.b 1 ;An eXtra byte.
- sizeof EQU 20
- ENDR
-
- ; Print Job: Print "form" for a single print request.
- ; The universal 120 byte printing record
- TPrStatus RECORD 0
- iTotPages ds.w 1 ;Total pages in Print File.
- iCurPage ds.w 1 ;Current page number
- iTotCopies ds.w 1 ;Total copies requested
- iCurCopy ds.w 1 ;Current copy number
- iTotBands ds.w 1 ;Total bands per page.
- iCurBand ds.w 1 ;Current band number
- fPgDirty ds.b 1 ;True if current page has been written to.
- fImaging ds.b 1 ;Set while in band's DrawPic call.
- hPrint ds.l 1 ;Handle to the active Printer record
- pPrPort ds.l 1 ;Ptr to the active PrPort
- hPic ds.l 1 ;Handle to the active Picture
- sizeof EQU 26
- ENDR
-
- ; Print Status: Print information during printing.
- TPfPgDir RECORD 0
- iPages ds.w 1
- iPgPos ds.l 129 ;ARRAY [0..iPfMaxPgs] OF LONGINT
- sizeof EQU 518
- ENDR
-
- ; PicFile = a TPfHeader followed by n QuickDraw Pics (whose PicSize is invalid!)
- TPrDlg RECORD 0
- Dlg ds DialogRecord ;The Dialog window
- pFltrProc ds.l 1 ;The Filter Proc.
- pItemProc ds.l 1 ;The Item evaluating proc.
- hPrintUsr ds.l 1 ;The user's print record.
- fDoIt ds.b 1
- fDone ds.b 1
- lUser1 ds.l 1 ;Four longs for user's to hang global data.
- lUser2 ds.l 1 ;...Plus more stuff needed by the particular printing dialog.
- lUser3 ds.l 1
- lUser4 ds.l 1
- sizeof EQU 200
- ENDR
-
- ; This is the Printing Dialog Record. Only used by folks appending their own dialogs.
- ;Print Dialog: The Dialog Stream object.
- TGnlData RECORD 0
- iOpCode ds.w 1
- iError ds.w 1
- lReserved ds.l 1 ;more fields here depending on call
- sizeof EQU 8
- ENDR
-
- TRslRg RECORD 0
- iMin ds.w 1
- iMax ds.w 1
- sizeof EQU 4
- ENDR
-
- TRslRec RECORD 0
- iXRsl ds.w 1
- iYRsl ds.w 1
- sizeof EQU 4
- ENDR
-
- TGetRslBlk RECORD 0
- iOpCode ds.w 1
- iError ds.w 1
- lReserved ds.l 1
- iRgType ds.w 1
- xRslRg ds TRslRg
- yRslRg ds TRslRg
- iRslRecCnt ds.w 1
- rgRslRec ds.b 27 * TRslRec
- sizeof EQU 128
- ENDR
-
- TSetRslBlk RECORD 0
- iOpCode ds.w 1
- iError ds.w 1
- lReserved ds.l 1
- hPrint ds.l 1
- iXRsl ds.w 1
- iYRsl ds.w 1
- sizeof EQU 16
- ENDR
-
- TDftBitsBlk RECORD 0
- iOpCode ds.w 1
- iError ds.w 1
- lReserved ds.l 1
- hPrint ds.l 1
- sizeof EQU 12
- ENDR
-
- TGetRotnBlk RECORD 0
- iOpCode ds.w 1
- iError ds.w 1
- lReserved ds.l 1
- hPrint ds.l 1
- fLandscape ds.b 1
- bXtra ds.b 1
- sizeof EQU 14
- ENDR
-
- IF GENERATING68K THEN
- Macro
- _PrPurge
- dc.w $2F3C
- dc.w $A800
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrPurge
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrNoPurge
- dc.w $2F3C
- dc.w $B000
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrNoPurge
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrOpen
- dc.w $2F3C
- dc.w $C800
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrOpen
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrClose
- dc.w $2F3C
- dc.w $D000
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrClose
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrintDefault
- dc.w $2F3C
- dc.w $2004
- dc.w $0480
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrintDefault
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrValidate
- dc.w $2F3C
- dc.w $5204
- dc.w $0498
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrValidate
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrStlDialog
- dc.w $2F3C
- dc.w $2A04
- dc.w $0484
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrStlDialog
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrJobDialog
- dc.w $2F3C
- dc.w $3204
- dc.w $0488
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrJobDialog
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrStlInit
- dc.w $2F3C
- dc.w $3C04
- dc.w $040C
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrStlInit
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrJobInit
- dc.w $2F3C
- dc.w $4404
- dc.w $0410
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrJobInit
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrJobMerge
- dc.w $2F3C
- dc.w $5804
- dc.w $089C
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrJobMerge
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrDlgMain
- dc.w $2F3C
- dc.w $4A04
- dc.w $0894
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrDlgMain
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrOpenDoc
- dc.w $2F3C
- dc.w $0400
- dc.w $0C00
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrOpenDoc
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrCloseDoc
- dc.w $2F3C
- dc.w $0800
- dc.w $0484
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrCloseDoc
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrOpenPage
- dc.w $2F3C
- dc.w $1000
- dc.w $0808
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrOpenPage
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrClosePage
- dc.w $2F3C
- dc.w $1800
- dc.w $040C
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrClosePage
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrPicFile
- dc.w $2F3C
- dc.w $6005
- dc.w $1480
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrPicFile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrError
- dc.w $2F3C
- dc.w $BA00
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrError
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrSetError
- dc.w $2F3C
- dc.w $C000
- dc.w $0200
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrSetError
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrGeneral
- dc.w $2F3C
- moveq #7,d0
- dc.w $0480
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrGeneral
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrDrvrOpen
- dc.w $2F3C
- dc.w $8000
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrDrvrOpen
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrDrvrClose
- dc.w $2F3C
- dc.w $8800
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrDrvrClose
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrCtlCall
- dc.w $2F3C
- dc.w $A000
- dc.w $0E00
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrCtlCall
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrDrvrDCE
- dc.w $2F3C
- dc.w $9400
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrDrvrDCE
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PrDrvrVers
- dc.w $2F3C
- dc.w $9A00
- dc.w $0000
- dc.w $A8FD
- EndM
- ELSE
- IMPORT PrDrvrVers
- ENDIF
-
- ENDIF ; __PRINTING__
-